/*
 *
 *      Copyright (c) 2018-2025, proj All rights reserved.
 *
 *  Redistribution and use in source and binary forms, with or without
 *  modification, are permitted provided that the following conditions are met:
 *
 * Redistributions of source code must retain the above copyright notice,
 *  this list of conditions and the following disclaimer.
 *  Redistributions in binary form must reproduce the above copyright
 *  notice, this list of conditions and the following disclaimer in the
 *  documentation and/or other materials provided with the distribution.
 *  Neither the name of the pig4cloud.com developer nor the names of its
 *  contributors may be used to endorse or promote products derived from
 *  this software without specific prior written permission.
 *  Author: proj
 *
 */

package com.ykht.proj.admin.api.feign;


import com.ykht.proj.common.core.constant.ServiceNameConstants;
import com.ykht.proj.common.core.util.R;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;


/**
 * 文件服务
 */
@FeignClient(contextId = "remoteFileService", value = ServiceNameConstants.UPMS_SERVICE)
public interface RemoteFileService {


	/**
	 * 上传文件 文件名采用uuid,避免原始文件名中带"-"符号导致下载的时候解析出现异常
	 *
	 * @param file 资源
	 * @return R(/ bucketName / fileName / url)
	 */
	@RequestMapping(value = "/sys-file/upload", method = RequestMethod.POST, consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
	R upload(@RequestPart("file") MultipartFile file);

	/**
	 * 传接口（企业三张图片） 文件名采用uuid,避免原始文件名中带"-"符号导致下载的时候解析出现异常
	 *
	 * @param file 资源
	 * @return R(/ bucketName / fileName / url)
	 */
	@RequestMapping(value = "/sys-file/upload", method = RequestMethod.POST, consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
	R uploadEnterprisePic(@RequestPart("file") MultipartFile file);


	@RequestMapping(value ="/sys-file/upload4url", method = RequestMethod.POST , consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
	R upload4url(@RequestPart("file") MultipartFile file);
}
